#ifndef SYSMONITORLOGWIDGET_H
#define SYSMONITORLOGWIDGET_H

#include <QDialog>
#include "dbservice.h"

typedef enum
{
    SYSMON_TIME_QUERY_MODE_UNLIMIT,
    SYSMON_TIME_QUERY_MODE_TODAY,
    SYSMON_TIME_QUERY_MODE_LAST_3DAYS,
    SYSMON_TIME_QUERY_MODE_LAST_7DAYS,
    SYSMON_TIME_QUERY_MODE_LAST_30DAYS,
    SYSMON_TIME_QUERY_MODE_LAST_SELECT
}SYSMON_TIME_QUERY_MODE;

typedef enum
{
    SYSMON_KIND_QUERY_MODE_UNLIMIT,
    SYSMON_KIND_QUERY_MODE_CPU,
    SYSMON_KIND_QUERY_MODE_MEM,
    SYSMON_KIND_QUERY_MODE_DISK
}SYSMON_KIND_QUERY_MODE;

namespace Ui {
class SysMonitorLogWidget;
}

class SysMonitorLogWidget : public QDialog
{
    Q_OBJECT

public:
    explicit SysMonitorLogWidget(QWidget *parent = 0);
    ~SysMonitorLogWidget();

private:
    Ui::SysMonitorLogWidget *ui;


    int currentPageNum = 1;

    int pageSize = 20;

    int maxDisplayPagesNum = 40;

    list<SysMonitorLog >logs;

    void query();

    void resizeLogTableWidget();

    void displayLogs();
private slots:
    void on_queryButton_clicked(bool checked);
    void on_deleteButton_clicked(bool checked);
    void on_firstPageButton_clicked(bool checked);
    void on_prePageButton_clicked(bool checked);
    void on_nextPageButton_clicked(bool checked);
    void on_lastPageButton_clicked(bool checked);
    void on_timeKindComboBox_currentIndexChanged(int index);

};

#endif // SYSMONITORLOGWIDGET_H
